import at.guigu.pojo.Brand;
import at.guigu.service.BrandService;
import org.junit.Test;

public class updateOne {
    //1 创建一个私有的BrandService对象
    private BrandService brandService = new BrandService();
    // 修改商品数据：修改动态字段
    @Test
    public void updatePart() {
        // 接收前端传回的修改后的参数
        int id = 4;
        String companyName = "小花公司";
        String brandName = "小花手机";
//        String description = "手机中的小小鸟";
//        int ordered = 90;
//        int status = 1;

        //将参数封装到对象中
        Brand brand = new Brand();
        brand.setId(id);
        brand.setCompanyName(companyName);
        brand.setBrandName(brandName);
//        brand.setDescription(description);
//        brand.setOrdered(ordered);
//        brand.setStatus(status);

        int nums = brandService.updatePart(brand);
        System.out.println(nums);
    }
}
